<?php

App::uses('AppController', 'Controller');

class UsersController extends AppController {
	
	public $uses = array('User');
	
	public function login() {
		if($this->request->is('post')) {
			Configure::write('debug',2);
			if(!$this->Auth->login()) {
				$this->setFlash('Prijava nije uspela. Proverite unete podatke pa pokušajte ponovo.', 'error');
			}
			//debug($this->User->getDataSource()->getLog());die;
			$this->redirect($this->Auth->redirect());
		}
	}
	public function logout() {
		$this->Auth->logout();
		$this->redirect($this->Auth->redirect());
	}
	
	public function dummy1(){
		$this->render('/pages/home');
	}
	
	public function dummy2(){
		$this->render('/pages/home');
	}
	
}